```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JVM调优参数详解 | 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.8;
        }
        .hero-bg {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .param-card {
            transition: all 0.3s ease;
        }
        .param-card:hover {
            background-color: #f8fafc;
            border-left: 4px solid #4f46e5;
        }
        .highlight {
            background-color: #e0e7ff;
            color: #4f46e5;
            padding: 0.2rem 0.4rem;
            border-radius: 0.25rem;
            font-family: monospace;
        }
        .section-title {
            position: relative;
            display: inline-block;
        }
        .section-title:after {
            content: '';
            position: absolute;
            bottom: -8px;
            left: 0;
            width: 50%;
            height: 3px;
            background: linear-gradient(to right, #4f46e5, #8b5cf6);
            border-radius: 3px;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-bg text-white py-20 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col items-center text-center">
                <h1 class="text-4xl md:text-5xl font-bold mb-6 font-serif">JVM性能调优参数指南</h1>
                <p class="text-xl md:text-2xl max-w-3xl mb-8 opacity-90">优化您的Java应用性能，提升响应速度与稳定性</p>
                <div class="bg-white bg-opacity-10 p-6 rounded-lg backdrop-blur-sm max-w-4xl">
                    <p class="text-lg mb-0">"根据应用程序的特性和性能需求，合理配置这些参数可以显著改善应用的响应时间、吞吐量和稳定性。在实际应用中，建议结合性能监控工具（如 <span class="font-mono">jstat</span>, <span class="font-mono">jconsole</span>, <span class="font-mono">VisualVM</span>）来观察调优效果，并根据具体情况进行调整。"</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-6xl px-4 py-12">
        <!-- Overview Section -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-lg overflow-hidden mb-12 card-hover transition-all duration-300">
                <div class="p-8">
                    <h2 class="text-3xl font-bold mb-6 text-gray-800 section-title">JVM调优核心概念</h2>
                    <div class="flex flex-col md:flex-row gap-8">
                        <div class="md:w-1/2">
                            <div class="mermaid">
                                graph TD
                                    A[JVM调优] --> B[堆内存设置]
                                    A --> C[垃圾回收器选择]
                                    A --> D[垃圾回收调优]
                                    A --> E[性能监控]
                                    B --> B1[初始堆内存 -Xms]
                                    B --> B2[最大堆内存 -Xmx]
                                    B --> B3[年轻代大小 -Xmn]
                                    C --> C1[Serial GC]
                                    C --> C2[Parallel GC]
                                    C --> C3[CMS GC]
                                    C --> C4[G1 GC]
                                    D --> D1[新生代/老年代比例]
                                    D --> D2[Eden/Survivor比例]
                                    D --> D3[最大GC暂停时间]
                                    E --> E1[GC日志]
                                    E --> E2[JMX监控]
                                    E --> E3[性能分析工具]
                            </div>
                        </div>
                        <div class="md:w-1/2">
                            <div class="bg-indigo-50 p-6 rounded-lg h-full">
                                <h3 class="text-xl font-semibold mb-4 text-indigo-800">调优关键点</h3>
                                <ul class="space-y-3">
                                    <li class="flex items-start">
                                        <i class="fas fa-check-circle text-indigo-600 mt-1 mr-2"></i>
                                        <span>根据应用需求平衡内存分配与GC频率</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check-circle text-indigo-600 mt-1 mr-2"></i>
                                        <span>选择适合应用场景的垃圾回收器</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check-circle text-indigo-600 mt-1 mr-2"></i>
                                        <span>监控GC行为并针对性优化参数</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check-circle text-indigo-600 mt-1 mr-2"></i>
                                        <span>避免内存泄漏和过度GC开销</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check-circle text-indigo-600 mt-1 mr-2"></i>
                                        <span>考虑应用特点（批处理/实时系统）</span>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Parameters Sections -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 section-title">详细参数说明</h2>
            
            <!-- 堆内存设置 -->
            <div class="bg-white rounded-lg shadow-md p-6 mb-8 param-card">
                <div class="flex items-center mb-4">
                    <div class="bg-indigo-100 p-3 rounded-full mr-4">
                        <i class="fas fa-memory text-indigo-600 text-xl"></i>
                    </div>
                    <h3 class="text-2xl font-semibold text-gray-800">1. 堆内存设置</h3>
                </div>
                <div class="ml-16 pl-2">
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-Xms&lt;size&gt;</span> - 设置JVM启动时的初始堆内存大小</p>
                        <p class="text-gray-600 ml-6">例如: <span class="font-mono bg-gray-100 px-2 py-1 rounded">-Xms2g</span> 设置初始堆内存为2GB</p>
                    </div>
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-Xmx&lt;size&gt;</span> - 设置JVM的最大堆内存大小</p>
                        <p class="text-gray-600 ml-6">例如: <span class="font-mono bg-gray-100 px-2 py-1 rounded">-Xmx4g</span> 设置最大堆内存为4GB</p>
                    </div>
                    <div class="mb-2">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-Xmn&lt;size&gt;</span> - 设置年轻代的大小</p>
                        <p class="text-gray-600 ml-6">例如: <span class="font-mono bg-gray-100 px-2 py-1 rounded">-Xmn1g</span> 设置年轻代大小为1GB</p>
                    </div>
                </div>
            </div>
            
            <!-- 垃圾回收器选择 -->
            <div class="bg-white rounded-lg shadow-md p-6 mb-8 param-card">
                <div class="flex items-center mb-4">
                    <div class="bg-purple-100 p-3 rounded-full mr-4">
                        <i class="fas fa-recycle text-purple-600 text-xl"></i>
                    </div>
                    <h3 class="text-2xl font-semibold text-gray-800">2. 垃圾回收器选择</h3>
                </div>
                <div class="ml-16 pl-2">
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:+UseSerialGC</span> - 使用Serial垃圾回收器（单线程）</p>
                        <p class="text-gray-600 ml-6">适用于客户端应用或小型服务</p>
                    </div>
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:+UseParallelGC</span> - 使用Parallel垃圾回收器（多线程，吞吐量优先）</p>
                        <p class="text-gray-600 ml-6">适用于后台处理，注重吞吐量的应用</p>
                    </div>
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:+UseConcMarkSweepGC</span> - 使用CMS垃圾回收器（并发标记-清除）</p>
                        <p class="text-gray-600 ml-6">适用于需要减少停顿时间的应用（JDK14已移除）</p>
                    </div>
                    <div class="">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:+UseG1GC</span> - 使用G1垃圾回收器</p>
                        <p class="text-gray-600 ml-6">适用于大堆内存和低延迟要求的应用（JDK9+默认）</p>
                    </div>
                </div>
            </div>
            
            <!-- 垃圾回收调优 -->
            <div class="bg-white rounded-lg shadow-md p-6 mb-8 param-card">
                <div class="flex items-center mb-4">
                    <div class="bg-green-100 p-3 rounded-full mr-4">
                        <i class="fas fa-tachometer-alt text-green-600 text-xl"></i>
                    </div>
                    <h3 class="text-2xl font-semibold text-gray-800">3. 垃圾回收调优</h3>
                </div>
                <div class="ml-16 pl-2">
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:NewRatio=&lt;ratio&gt;</span> - 设置年轻代和老年代的比例</p>
                        <p class="text-gray-600 ml-6">例如: <span class="font-mono bg-gray-100 px-2 py-1 rounded">-XX:NewRatio=2</span> 将年轻代设置为老年代的1/2</p>
                    </div>
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:SurvivorRatio=&lt;ratio&gt;</span> - 设置Eden区和Survivor区的比例</p>
                        <p class="text-gray-600 ml-6">例如: <span class="font-mono bg-gray-100 px-2 py-1 rounded">-XX:SurvivorRatio=8</span></p>
                    </div>
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:MaxGCPauseMillis=&lt;time&gt;</span> - 设定G1垃圾回收器的最大停顿时间目标（毫秒）</p>
                        <p class="text-gray-600 ml-6">例如: <span class="font-mono bg-gray-100 px-2 py-1 rounded">-XX:MaxGCPauseMillis=200</span></p>
                    </div>
                    <div class="">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:G1HeapRegionSize=&lt;size&gt;</span> - 设置G1垃圾回收器中每个区域的大小</p>
                        <p class="text-gray-600 ml-6">例如: <span class="font-mono bg-gray-100 px-2 py-1 rounded">-XX:G1HeapRegionSize=16m</span></p>
                    </div>
                </div>
            </div>
            
            <!-- 垃圾回收日志 -->
            <div class="bg-white rounded-lg shadow-md p-6 mb-8 param-card">
                <div class="flex items-center mb-4">
                    <div class="bg-blue-100 p-3 rounded-full mr-4">
                        <i class="fas fa-file-alt text-blue-600 text-xl"></i>
                    </div>
                    <h3 class="text-2xl font-semibold text-gray-800">4. 垃圾回收日志</h3>
                </div>
                <div class="ml-16 pl-2">
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:+PrintGCDetails</span> - 输出详细的垃圾回收信息</p>
                    </div>
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:+PrintGCDateStamps</span> - 在垃圾回收日志中添加时间戳</p>
                    </div>
                    <div class="">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-Xloggc:&lt;file&gt;</span> - 指定垃圾回收日志的文件</p>
                        <p class="text-gray-600 ml-6">例如: <span class="font-mono bg-gray-100 px-2 py-1 rounded">-Xloggc:/path/to/gc.log</span></p>
                    </div>
                </div>
            </div>
            
            <!-- 其他调优参数 -->
            <div class="bg-white rounded-lg shadow-md p-6 mb-8 param-card">
                <div class="flex items-center mb-4">
                    <div class="bg-yellow-100 p-3 rounded-full mr-4">
                        <i class="fas fa-cogs text-yellow-600 text-xl"></i>
                    </div>
                    <h3 class="text-2xl font-semibold text-gray-800">5. 其他调优参数</h3>
                </div>
                <div class="ml-16 pl-2">
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:+UseStringDeduplication</span> - 启用字符串去重（G1垃圾回收器特性）</p>
                    </div>
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:+AlwaysPreTouch</span> - 启动时预分配堆内存，避免运行时分配带来的延迟</p>
                    </div>
                    <div class="">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:+DisableExplicitGC</span> - 禁用System.gc()显式垃圾回收调用</p>
                    </div>
                </div>
            </div>
            
            <!-- 性能监控 -->
            <div class="bg-white rounded-lg shadow-md p-6 param-card">
                <div class="flex items-center mb-4">
                    <div class="bg-red-100 p-3 rounded-full mr-4">
                        <i class="fas fa-chart-line text-red-600 text-xl"></i>
                    </div>
                    <h3 class="text-2xl font-semibold text-gray-800">6. 性能监控</h3>
                </div>
                <div class="ml-16 pl-2">
                    <div class="mb-4">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:+PrintFlagsFinal</span> - 打印JVM启动时所有参数的最终值，帮助诊断JVM配置</p>
                    </div>
                    <div class="">
                        <p class="font-medium text-gray-700 mb-2"><span class="highlight">-XX:+UnlockExperimentalVMOptions</span> - 解锁实验性JVM选项，允许使用未公开的功能</p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Best Practices -->
        <section class="mb-16">
            <div class="bg-gradient-to-r from-indigo-50 to-purple-50 rounded-xl p-8">
                <h2 class="text-3xl font-bold mb-6 text-gray-800 section-title">JVM调优最佳实践</h2>
                <div class="grid md:grid-cols-2 gap-6">
                    <div class="bg-white p-6 rounded-lg shadow-sm">
                        <h3 class="text-xl font-semibold mb-4 text-indigo-700 flex items-center">
                            <i class="fas fa-lightbulb mr-3"></i> 通用建议
                        </h3>
                        <ul class="space-y-3">
                            <li class="flex items-start">
                                <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                                <span>生产环境设置 <span class="highlight">-Xms</span> 和 <span class="highlight">-Xmx</span> 相同值，避免堆扩展带来的性能损耗</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                                <span>年轻代大小通常设为堆的1/3到1/2</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                                <span>使用G1 GC时，考虑设置合理的 <span class="highlight">MaxGCPauseMillis</span></span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                                <span>启用GC日志以便后续分析</span>
                            </li>
                        </ul>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-sm">
                        <h3 class="text-xl font-semibold mb-4 text-purple-700 flex items-center">
                            <i class="fas fa-exclamation-triangle mr-3"></i> 常见陷阱
                        </h3>
                        <ul class="space-y-3">
                            <li class="flex items-start">
                                <i class="fas fa-times text-red-500 mt-1 mr-2"></i>
                                <span>堆内存设置过大导致频繁Full GC</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-times text-red-500 mt-1 mr-2"></i>
                                <span>年轻代设置过小导致过早晋升老年代</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-times text-red-500 mt-1 mr-2"></i>
                                <span>Survivor区不足导致对象直接晋升老年代</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-times text-red-500 mt-1 mr-2"></i>
                                <span>未监控GC行为导致性能问题难排查</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <!-- Tools Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 section-title">JVM监控与分析工具</h2>
            <div class="grid md:grid-cols-3 gap-6">
                <div class="bg-white p-6 rounded-lg shadow-md hover:shadow-lg transition-shadow">
                    <div class="flex items-center mb-4">
                        <div class="bg-blue-100 p-3 rounded-full mr-4">
                            <i class="fas fa-terminal text-blue-600"></i>
                        </div>
                        <h3 class="text-xl font-semibold">jstat</h3>
                    </div>
                    <p class="text-gray-600">轻量级命令行工具，监控JVM内存、GC、类加载等统计信息。</p>
                    <div class="mt-4">
                        <span class="inline-block bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded">命令示例:</span>
                        <code class="block bg-gray-100 p-2 rounded mt-1 text-sm">jstat -gcutil &lt;pid&gt; 1000 10</code>
                    </div>
                </div>
                <div class="bg-white p-6 rounded-lg shadow-md hover:shadow-lg transition-shadow">
                    <div class="flex items-center mb-4">
                        <div class="bg-green-100 p-3 rounded-full mr-4">
                            <i class="fas fa-desktop text-green-600"></i>
                        </div>
                        <h3 class="text-xl font-semibold">jconsole</h3>
                    </div>
                    <p class="text-gray-600">图形化监控工具，提供内存、线程、类、MBean等综合视图。</p>
                    <div class="mt-4">
                        <span class="inline-block bg-green-100 text-green-800 text-xs px-2 py-1 rounded">启动方式:</span>
                        <code class="block bg-gray-100 p-2 rounded mt-1 text-sm">jconsole &lt;pid&gt;</code>
                    </div>
                </div>
                <div class="bg-white p-6 rounded-lg shadow-md hover:shadow-lg transition-shadow">
                    <div class="flex items-center mb-4">
                        <div class="bg-purple-100 p-3 rounded-full mr-4">
                            <i class="fas fa-chart-bar text-purple-600"></i>
                        </div>
                        <h3 class="text-xl font-semibold">VisualVM</h3>
                    </div>
                    <p class="text-gray-600">功能强大的可视化工具，集监控、分析、调优于一体。</p>
                    <div class="mt-4">
                        <span class="inline-block bg-purple-100 text-purple-800 text-xs px-2 py-1 rounded">插件支持:</span>
                        <span class="text-sm text-gray-600">GC分析、线程分析、堆转储分析等</span>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8">
        <div class="container mx-auto max-w-6xl px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-semibold text-white">技术小馆</h3>
                    <p class="mt-1">专业的Java技术分享平台</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-indigo-400 hover:text-indigo-300 transition-colors" target="_blank">
                        <i class="fas fa-globe mr-2"></i>http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-6 pt-6 text-center text-sm text-gray-500">
                © 2023 技术小馆. 保留所有权利.
            </div>
        </div>
    </footer>

    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true,
                curve: 'basis'
            }
        });
        
        // Smooth scroll for anchor links
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
        
        // Add hover effect to parameter cards
        document.querySelectorAll('.param-card').forEach(card => {
            card.addEventListener('mouseenter', function() {
                this.style.transform = 'translateY(-3px)';
                this.style.boxShadow = '0 10px 15px -3px rgba(0, 0, 0, 0.1)';
            });
            card.addEventListener('mouseleave', function() {
                this.style.transform = '';
                this.style.boxShadow = '';
            });
        });
    </script>
</body>
</html>
```